home *** CD-ROM | disk | FTP | other *** search
/ MacWorld 1995 November / Macworld Nov ’95.toast / Education / xModels 2D and 3D / Tutorial Examples / Tutorial 1. Basic Concepts next >
Encoding:
Text File  |  1995-06-22  |  2.3 KB  |  52 lines  |  [TEXT/X_#9]

  1. ; Tutorial 1:  Basic Concepts
  2. ;
  3. ; In xModelx-2D and xModels-3D, you create a "scene description"
  4. ; in a special language.  The scene description is a kind of
  5. ; program for a scene.  A scene can be a single image or an
  6. ; animation consisting of a sequence of images.
  7. ;
  8. ; Anything on a line after a ";" is considered a comment, not part
  9. ; of the scene description.
  10. ;
  11. ; An object can be added to a scene by giving the name of that
  12. ; object.  There are some standard objects:
  13.  
  14.         square   ; a one-by-one square, centered at the point (0,0)
  15.         circle   ; a circle of radius 1, with center at (0,0)
  16.         line     ; a horizontal line, length 1, center at (0,0)
  17.  
  18. ; After the name of the object, you can list "transformations"
  19. ; to be applied to the object.  These transformations affect
  20. ; the object's size, orientation, and position, BEFORE it is
  21. ; actually drawn in the image.  For example, the transformation
  22. ; "scale 5" magnifies the size of the object by a factor of 5.
  23. ; You would apply this to the basic "square" object like this:
  24.  
  25.        square scale 5  ; a 5-by-5 square, centered at (0,0)
  26.  
  27. ; Other important transformations include "rotate" and "translate".
  28. ; Several transformations can be applied to the same object.  They
  29. ; are performed in the order listed:
  30.  
  31.        circle translate 4,7 ; circle of radius 1, displced by 4
  32.                             ; units horizontally and 7 units
  33.                             ; vertically, so its center is
  34.                             ; now at the point (4,7)
  35.  
  36.       line scale 10 rotate 45 translate -3,0
  37.              ; a line of length 10 (because of the scaling),
  38.              ; at an angle of 45 degrees from horizontal,
  39.              ; shoved 3 units to the left, so its center is (-3,0)
  40.  
  41. ; The parts of this file that are not comments define a scene
  42. ; containing 6 objects.  To see that scene, choose the "Render"
  43. ; command from the "Control" Menu.  The objects are displayed
  44. ; in a square window whose horizontal coordinates extend from -10
  45. ; on the left to +10 on the right, and whose vertical coordinates
  46. ; extend from -10 at the bottom to +10 at the top.  The point
  47. ; (0,0) is the center of the square.
  48. ;
  49. ; When you render this file, you will see the basic square, line,
  50. ; and circle as three small objects at the center of the screen.
  51. ; You'll also see three transformed objects.
  52.